// NAB MRC 170x250
if(typeof aucomviCalculatorAd == 'undefined'){
	aucomviCalculatorAd = new Object();
}

aucomviCalculatorAd.init = function(){
		
	vicomau_formValidate({
		vicomau_loan_amount:{
			vicomau_loan_amount_default: 200000,
			vicomau_loan_amount_min: 15000,
			vicomau_loan_amount_max: 10000000
		},
		vicomau_interest_rate:{
			vicomau_interest_rate_default: 6.78,
			vicomau_interest_rate_min: 0.25,
			vicomau_interest_rate_max: 20
		},
		vicomau_loan_term:{
			vicomau_loan_term_default: 30,
			vicomau_loan_term_min: 1,
			vicomau_loan_term_max: 30
		}
	});
}
	
aucomviCalculatorAd.launch_overlay = function(){
	
	var vicomau_loan_amount_val = adObj.get_input_by_id('au-com-vi-calculators-application_loan-amount').finalValue;
	var vicomau_interest_rate_val = adObj.get_input_by_id('au-com-vi-calculators-application_interest-rate').finalValue;
	var vicomau_loan_term_val = adObj.get_input_by_id('au-com-vi-calculators-application_loan-term').finalValue;
	
	// set cdnPath
	vicomauREACalculator({
		display:'overlay',
	  	nid:63,
	  	field_referrer:'buy',
	  	cdnPath:'http://cdn.vi.com.au/realestate.com.au.calculators.vi.com.au/nab-branded/REA9110/',
	  	dataObj:{
		 	field_loan_amount:{value:vicomau_loan_amount_val},
		 	field_interest_rate:{value:vicomau_interest_rate_val},
		 	field_loan_term:{value:vicomau_loan_term_val}
	   	}
	});
}